<?php

namespace app\api\controller;
use think\Controller;
use think\Request;
use think\Db;
class Bar extends BaseController
{
    public function Bar(){
        {
            //进行数据库查询nav
            $data = Db::name('bar a')
            ->field('a.id,a.name,a.url,a.pid')
            ->select();
            if ($data) {
                return json(['code' => 200, 'msg' => "成功", 'data' => $data]);
            } else {
                return json(['code' => 0, 'msg' => "失败", 'data' => []]);
            }
        }
    }
}